Optimal. Leaf size=51 \[ -\frac {1}{2} e^x \cos (x)+\frac {1}{2} e^x x^2 \cos (x)+\frac {1}{2} e^x \sin (x)-e^x x \sin (x)+\frac {1}{2} e^x x^2 \sin (x) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 51, normalized size of antiderivative = 1.00, number of steps
used = 11, number of rules used = 5, integrand size = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.556, Rules used = {4518, 4554, 14,
4517, 4553} \begin {gather*} \frac {1}{2} e^x x^2 \sin (x)+\frac {1}{2} e^x x^2 \cos (x)-e^x x \sin (x)+\frac {1}{2} e^x \sin (x)-\frac {1}{2} e^x \cos (x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 14
Rule 4517
Rule 4518
Rule 4553
Rule 4554
Rubi steps
\begin {align*} \int e^x x^2 \cos (x) \, dx &=\frac {1}{2} e^x x^2 \cos (x)+\frac {1}{2} e^x x^2 \sin (x)-2 \int x \left (\frac {1}{2} e^x \cos (x)+\frac {1}{2} e^x \sin (x)\right ) \, dx\\ &=\frac {1}{2} e^x x^2 \cos (x)+\frac {1}{2} e^x x^2 \sin (x)-2 \int \left (\frac {1}{2} e^x x \cos (x)+\frac {1}{2} e^x x \sin (x)\right ) \, dx\\ &=\frac {1}{2} e^x x^2 \cos (x)+\frac {1}{2} e^x x^2 \sin (x)-\int e^x x \cos (x) \, dx-\int e^x x \sin (x) \, dx\\ &=\frac {1}{2} e^x x^2 \cos (x)-e^x x \sin (x)+\frac {1}{2} e^x x^2 \sin (x)+\int \left (-\frac {1}{2} e^x \cos (x)+\frac {1}{2} e^x \sin (x)\right ) \, dx+\int \left (\frac {1}{2} e^x \cos (x)+\frac {1}{2} e^x \sin (x)\right ) \, dx\\ &=\frac {1}{2} e^x x^2 \cos (x)-e^x x \sin (x)+\frac {1}{2} e^x x^2 \sin (x)+2 \left (\frac {1}{2} \int e^x \sin (x) \, dx\right )\\ &=\frac {1}{2} e^x x^2 \cos (x)-e^x x \sin (x)+\frac {1}{2} e^x x^2 \sin (x)+2 \left (-\frac {1}{4} e^x \cos (x)+\frac {1}{4} e^x \sin (x)\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.04, size = 23, normalized size = 0.45 \begin {gather*} \frac {1}{2} e^x (-1+x) ((1+x) \cos (x)+(-1+x) \sin (x)) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.06, size = 28, normalized size = 0.55
method | result | size |
default | \(\left (\frac {x^{2}}{2}-\frac {1}{2}\right ) {\mathrm e}^{x} \cos \left (x \right )-\left (-\frac {1}{2} x^{2}+x -\frac {1}{2}\right ) {\mathrm e}^{x} \sin \left (x \right )\) | \(28\) |
risch | \(\left (\frac {1}{4}-\frac {i}{4}\right ) \left (x^{2}+i x -x -i\right ) {\mathrm e}^{\left (1+i\right ) x}+\left (\frac {1}{4}+\frac {i}{4}\right ) \left (x^{2}-i x -x +i\right ) {\mathrm e}^{\left (1-i\right ) x}\) | \(48\) |
norman | \(\frac {{\mathrm e}^{x} \tan \left (\frac {x}{2}\right )+{\mathrm e}^{x} x^{2} \tan \left (\frac {x}{2}\right )+\frac {{\mathrm e}^{x} x^{2}}{2}+\frac {{\mathrm e}^{x} \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{2}-2 \,{\mathrm e}^{x} x \tan \left (\frac {x}{2}\right )-\frac {{\mathrm e}^{x} x^{2} \left (\tan ^{2}\left (\frac {x}{2}\right )\right )}{2}-\frac {{\mathrm e}^{x}}{2}}{1+\tan ^{2}\left (\frac {x}{2}\right )}\) | \(73\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 26, normalized size = 0.51 \begin {gather*} \frac {1}{2} \, {\left (x^{2} - 1\right )} \cos \left (x\right ) e^{x} + \frac {1}{2} \, {\left (x^{2} - 2 \, x + 1\right )} e^{x} \sin \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.52, size = 26, normalized size = 0.51 \begin {gather*} \frac {1}{2} \, {\left (x^{2} - 1\right )} \cos \left (x\right ) e^{x} + \frac {1}{2} \, {\left (x^{2} - 2 \, x + 1\right )} e^{x} \sin \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.32, size = 48, normalized size = 0.94 \begin {gather*} \frac {x^{2} e^{x} \sin {\left (x \right )}}{2} + \frac {x^{2} e^{x} \cos {\left (x \right )}}{2} - x e^{x} \sin {\left (x \right )} + \frac {e^{x} \sin {\left (x \right )}}{2} - \frac {e^{x} \cos {\left (x \right )}}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.38, size = 24, normalized size = 0.47 \begin {gather*} \frac {1}{2} \, {\left ({\left (x^{2} - 1\right )} \cos \left (x\right ) + {\left (x^{2} - 2 \, x + 1\right )} \sin \left (x\right )\right )} e^{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.36, size = 22, normalized size = 0.43 \begin {gather*} \frac {{\mathrm {e}}^x\,\left (x-1\right )\,\left (\cos \left (x\right )-\sin \left (x\right )+x\,\cos \left (x\right )+x\,\sin \left (x\right )\right )}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________